﻿using System;
using System.Data;
using System.IO;
using StockApi.Interfaces;

namespace StockApi.InputOutput
{
    public class Csv : IFileType
    {
        public Type GetTypeOf<T>()
        {
            return typeof (T);
        }

        public string FileName { get; set; }

        public void Write<T>(DataTable table)
        {
            using (var stream = new StreamWriter(FileName))
            {
                stream.Write(table);
            }
        }
    }
}